home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / et / et3_0-a1.lha / et3 / src / Picture.h < prev    next >
C/C++ Source or Header  |  1992-07-10  |  2KB  |  85 lines

  1. #ifndef Picture_First
  2. #ifdef __GNUG__
  3. //pragma once
  4. #pragma interface
  5. #endif
  6. #define Picture_First
  7.  
  8. #include "Port.h"
  9. #include "Object.h"
  10.  
  11. class ObjArray;
  12. class Collection;
  13.  
  14. enum PicCodes {
  15.     cPicEnd= 0,
  16.     cPicFont,
  17.     cPicInk,
  18.     cPicClip,
  19.     cPicStartAngle,
  20.     cPicEndAngle,
  21.     cPicPensize,
  22.     cPicPenCap,
  23.  
  24.     cPicStrokeRect,
  25.     cPicStrokeRRect,
  26.     cPicStrokeOval,
  27.     cPicStrokeWedge,
  28.     cPicStrokePoly,
  29.  
  30.     cPicFillRect,
  31.     cPicFillOval,
  32.     cPicFillRRect,
  33.     cPicFillWedge,
  34.     cPicFillPoly,
  35.  
  36.     cPicHint,
  37.     cPicEsc,
  38.     cPicShowBitmap,
  39.     cPicShowPicture, 
  40.  
  41.     cPicXMove0      = 128,
  42.  
  43.     cPicMove        = 128+64+0,
  44.     cPicLine        = 128+64+16,
  45.     cPicCornerDia   = 128+64+32,
  46.     cPicExtent      = 128+64+48
  47. };
  48.  
  49. //---- Picture -----------------------------------------------------------------
  50.  
  51. class Picture: public Object {
  52. protected:
  53.     byte *buf;
  54.     int length;
  55.     ObjArray *map;
  56.     Rectangle bbox;
  57.  
  58. public:
  59.     MetaDef(Picture);
  60.  
  61.     Picture();
  62.     Picture(Rectangle &b, byte *pagebuf, long len, ObjArray *m);
  63.     ~Picture();
  64.  
  65.     void Set(Rectangle &b, byte *pagebuf, long len, ObjArray *m);
  66.     bool LoadEPSIfile(const char *name);
  67.     int Length()
  68.     { return length; }
  69.     Point Offset()
  70.     { return bbox.origin; }
  71.     Point Size()
  72.     { return bbox.extent; }
  73.     Rectangle BBox()
  74.     { return bbox; }
  75.  
  76.     void Show(Rectangle *r, Port *port);
  77.     
  78.     OStream& PrintOn(OStream&);
  79.     IStream& ReadFrom(IStream&);
  80.     
  81.     void CollectParts(Collection *col);
  82. };
  83.  
  84. #endif
  85.